import cv2
import numpy as np
import os
import sys
sys.path.append(os.getcwd())
from config.env import Env
env = Env()

cap = cv2.VideoCapture(env.getVideoPath() + "sample_video.mp4")

if not cap.isOpened():
    print("没有捕获到视频")
    exit()
while True:
    ret, frame = cap.read()
    if not ret:
        print("视频播放完毕，正在退出...")
        break
    cv2.imshow("video", frame)

    if cv2.waitKey(1) == ord("q"):
        break
cap.release()
cv2.destroyAllWindows()